import threading
class MyThread(threading.Thread):
    def __init__(self,begin,end):
        threading.Thread.__init__(self)
        self.begin=begin
        self.end=end
    def run(self):
        self.result=0
        for i in range(self.begin,self.end):
            self.result+=i
t0=MyThread(1,51);t1=MyThread(51,101)
t0.start();t1.start();t0.join();t1.join()
print(t0.result,t1.result)
result=t0.result+t1.result
print(result)
